package com.encyclopedia.controller;

import com.encyclopedia.result.JsonRequest;
import com.encyclopedia.service.CommentsService;
import jakarta.annotation.security.PermitAll;
import lombok.experimental.Delegate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author MaLiang
 * @version 1.0
 * @date 2024-05-04 1:02
 */
@RestController
@RequestMapping("/comments/comments")
public class CommentsController {

    @Autowired
    private CommentsService commentsService;

    @GetMapping("/{id}")
    public JsonRequest getInfo(@PathVariable("id") Integer id){
        return JsonRequest.success(commentsService.getInfo(id));
    }
}
